﻿using net_work.Common.Request;
using net_work.Common.Result;
using net_work.Data.DTO.Sys;
using net_work.Data.Entity.Sys;

namespace net_work.IService.Sys;

public interface IUserService
{
    /// <summary>
    /// 分页查询用户
    /// </summary>
    /// <param name="request">查询参数</param>
    /// <returns>分页结果</returns>
    Task<PagedResult<User>> GetUsersPagedAsync(PagedRequest request);

    /// <summary>
    /// 根据用户ID查询用户信息
    /// </summary>
    /// <param name="userId">用户ID</param>
    /// <returns>用户信息</returns>
    Task<User?> SelectByIdAsync(long userId);

    /// <summary>
    /// 插入用户
    /// </summary>
    /// <param name="userAddRequest">新增用户实体</param>
    /// <returns>新增用户ID</returns>
    Task<long> InsertUser(UserAddRequest userAddRequest);

    /// <summary>
    /// 更新用户信息
    /// </summary>
    /// <param name="userUpdateRequest">更新用户信息</param>
    /// <returns>是否成功</returns>
    Task<int> UpdateUser(UserUpdateRequest userUpdateRequest);

    /// <summary>
    /// 删除用户
    /// </summary>
    /// <param name="ids">用户ID集合</param>
    /// <returns>是否成功</returns>
    Task<int> DeleteUserByIds(List<long> ids);
}